#*-coding:Utf-8 -*
#!/usr/bin/python3.2

from Classes.clef import *
mod = 203
priv = clef_privee().load("priv")

erreur = [elt(0,mod) for i in range(priv.G.nbligne)]
mot = []

for i in range(priv.G.nbcolonne):
	mot.append(elt( randint(0,1) ,mod))
mot1 = matrice(priv.G.nbcolonne,1,mot)

mot2 = priv.G * mot1

aa=[]
for i in range(priv.correction):
	a= randint(0,priv.G.nbligne-1)
	erreur[a]=elt(1,2)
	aa.append(a)
print aa
erreur = matrice(priv.G.nbligne,1,erreur)
print

mot3 = mot2 + erreur

resultat = corrige(priv.g,mot3,priv.support,priv.L_fi,priv.mod)
resultat = priv.D * resultat

print (mot1-resultat).tableau